<?php

namespace app\common\model;

//use think\Model;

class BlockBrowserModel extends BaseModel{

	protected $table = 'tp_block_browser';

	/*
	添加记录
	 */
	public function addRecord($wid,$type,$change,$memo,$from_address,$to_address,$height_id){
		
		if ($from_address == '') {
			$from_address = C('system_address');

		} 
		if ($to_address == '') {
			$to_address = C('system_address');
		}

		if (empty($height_id)) {
			$height_id = 0;
		}
		$data = [
			'wid'=>$wid,
			'type'=>$type,
			'change'=>$change,
			'memo'=>$memo,
			'from_address'=>$from_address,
			'to_address'=>$to_address,
			'status'=>1,
			'height_id'=>$height_id,
			'over_string'=>md5($wid.microtime().$type).md5(microtime()),
			'date'=>$this->getDate()
		];
		$res = $this->insertGetId($data);
		return $res;
	}
}